<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width"/>
        <title>Clinica</title>
        <link href="<?php echo $this->webroot; ?>css/reset.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/layout.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/themes.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/typography.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/styles.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/shCore.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/bootstrap.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/jquery.jqplot.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/data-table.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/form.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/ui-elements.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/wizard.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/sprite.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->webroot; ?>css/gradient.css" rel="stylesheet" type="text/css">
        <!--[if IE 7]>
        <link rel="stylesheet" type="text/css" href="css/ie/ie7.css" />
        <![endif]-->
        <!--[if IE 8]>
        <link rel="stylesheet" type="text/css" href="css/ie/ie8.css" />
        <![endif]-->
        <!--[if IE 9]>
        <link rel="stylesheet" type="text/css" href="css/ie/ie9.css" />
        <![endif]-->
        <!-- Jquery -->
        <script src="<?php echo $this->webroot; ?>js/jquery-1.7.1.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery-ui-1.8.18.custom.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.ui.touch-punch.js"></script>
        <!--<script src="<?php //echo $this->webroot; ?>js/jquery.sheepItPlugin-1.1.1.min.js"></script>-->
        <script src="<?php echo $this->webroot; ?>js/chosen.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/uniform.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/bootstrap-dropdown.js"></script>
        <script src="<?php echo $this->webroot; ?>js/bootstrap-colorpicker.js"></script>
        <script src="<?php echo $this->webroot; ?>js/sticky.full.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.noty.js"></script>
        <script src="<?php echo $this->webroot; ?>js/selectToUISlider.jQuery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/fg.menu.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.tagsinput.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.cleditor.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.tipsy.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.peity.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.simplemodal.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.jBreadCrumb.1.1.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.colorbox-min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.idTabs.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.multiFieldExtender.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.confirm.js"></script>
        <script src="<?php echo $this->webroot; ?>js/elfinder.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/accordion.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/autogrow.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/check-all.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/data-table.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/ZeroClipboard.js"></script>
        <script src="<?php echo $this->webroot; ?>js/TableTools.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jeditable.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/duallist.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/easing.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/full-calendar.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/input-limiter.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/inputmask.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/iphone-style-checkbox.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/meta-data.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/quicksand.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/raty.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/smart-wizard.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/stepy.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/treeview.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/ui-accordion.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/vaidation.jquery.js"></script>
        <script src="<?php echo $this->webroot; ?>js/mosaic.1.0.1.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.collapse.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.cookie.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.autocomplete.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/localdata.js"></script>
        <script src="<?php echo $this->webroot; ?>js/excanvas.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.jqplot.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.dateAxisRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.cursor.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.logAxisRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.canvasTextRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.highlighter.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.pieRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.barRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.categoryAxisRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.pointLabels.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/chart-plugins/jqplot.meterGaugeRenderer.min.js"></script>
        <script src="<?php echo $this->webroot; ?>js/custom-scripts.js"></script>
        <script src="<?php echo $this->webroot; ?>js/jquery.bpopup.min.js"></script>    
          
        <script>
            var inactivityTime = function () {
            var t;
            window.onload = resetTimer;
            document.onmousemove = resetTimer;
            document.onkeypress = resetTimer;
        
            function logout() {
                //alert("You are now logged out.");
                //location.href = 'http://localhost/hospital/';
            }
        
            function resetTimer() {
                clearTimeout(t);
                t = setTimeout(logout, 30000)
                // 1000 milisec = 1 sec
            }
        };
        $(document).ready(function(){
            inactivityTime();    
        });
        </script>    
    </head>
    <body id="theme-default" class="full_block">
        <div id="left_bar">
            <div id="primary_nav" class="g_blue">
                <ul>
                    <?php $rol = $this->Session->read("Auth.User.group_id")?>
                    <?php if($rol == 1):?>
                    <?php echo $this->element('sidebar/menu_principal'); ?>
                    <?php elseif($rol == 2):?>
                    <?php echo $this->element('sidebar/menu_medico'); ?>
                    <?php elseif($rol == 5):?>
                    <?php echo $this->element('sidebar/menu_laboratorio'); ?>
                    <?php else:?>
                    <?php echo $this->element('sidebar/menu_auxiliar'); ?>
                    <?php endif;?>    
                </ul>
            </div>
            <?php $rol = $this->Session->read("Auth.User.group_id")?>
            <?php if($rol == 1):?>
            <?php echo $this->element('menu_principal'); ?>
            <?php elseif($rol == 2):?>
            <?php echo $this->element('menu_medico'); ?>
            <?php elseif($rol == 5):?>
            <?php
                echo $this->Ajax->remoteTimer(
                        array(
                            'url' => array('controller' => 'Pacientes', 'action' => 'ajaxalertalaboratorios'),
                            'update' => 'cargaNotificaciones', 'frequency' => 600
                        )
                );
                ?>
            <div id="cargaNotificaciones" style="display: none;">
                
            </div>
            <?php echo $this->element('menu_laboratorio'); ?>
            <?php else:?>
            <?php echo $this->element('menu_auxiliar'); ?>
            <?php endif;?>
        </div>
        <div id="container">
            <?php //echo $this->element("sidebar/menu")?>        
            <?php echo $this->element("cabecera") ?>    
            <?php echo $this->Session->flash(); ?>
            <?php echo $this->fetch('content'); ?>
        </div>
        <p></p> <p></p> <p></p>
                <div style="text-align: center; color:gray;">
                <p class="f-left">&copy; 2013 <strong class="green">Hospital Fundacion "Pietro Gamba"</strong>, Todos Los Derechos Reservados &reg;</p>
                <p class="f-right">Dise&ntilde;ado y Desarrollado por la Consultora <a href="http://www.labware.com.bo/">http://www.labware.com.bo</a></p>              
                <?php echo date('g:i a'); ?>
                </div>  
    </body>
</html>